class Teacher implements Comparable {
    String name
    SortedSet students
    static hasMany = [students: Student]
    
    static constraints = {
    	name(unique: true)
    }
    
    String toString() {
        name
    }
    
    int compareTo(obj) {
    	name.compareTo(obj.name)
    }
}
